package com.bosssoft.trainee.entity.vo;

import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * @author liuqiang
 * @date 2022/7/4 20:20
 */
@Data
public class UserVO {

    private Integer userId;

    @NotEmpty(message = "用户编号不能为空")
    @Size(min = 2, max = 6, message = "用户编号不少于2位不长于6位")
    @Pattern(regexp = "^[a-zA-Z0-9]+$", message = "用户编号不能包含特殊字符")
    private String userCode;

    @NotEmpty(message = "用户名不能为空")
    @Size(min = 2, max = 10, message = "用户名称不少于2位不长于10位")
    private String userName;

    @NotEmpty(message = "用户性别不能为空")
    private String userGender;

    @NotEmpty(message = "用户角色不能为空")
    private String userRole;

    @NotEmpty(message = "用户电话不能为空")
    @Pattern(regexp = "^1[3|4|5|6|7|8|9][0-9]\\d{8}$", message = "手机号码格式不正确")
    private String userTele;

    @NotEmpty(message = "用户邮箱不能为空")
    @Pattern(regexp = "^[A-Za-z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$", message = "邮箱格式不正确")
    private String userEmail;

    @NotEmpty(message = "用户账号不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9]+$", message = "用户账号不能包含特殊字符")
    @Size(min = 5, max = 15, message = "用户编号不少于5位不长于15位")
    private String userAccount;

    @NotEmpty(message = "用户密码不能为空")
    @Pattern(regexp = "^(?![\\d]+$)(?![a-zA-Z]+$)(?![^\\da-zA-Z]+$)([^\\u4e00-\\u9fa5\\s]){6,20}$", message = "6-20位英文字母、数字或者符号（除空格），且字母、数字和标点符号至少包含两种")
    private String userPassword;

    @NotEmpty(message = "用户状态不能为空")
    private String userState;
}
